package com.druid.response.openai;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class OpenAIChatResponse {

    @JsonProperty("id")
    private String id;
    @JsonProperty("object")
    private String object;
    @JsonProperty("created")
    private long created;
    @JsonProperty("choices")
    private ChatChoice[] choices;
    @JsonProperty("usage")
    private ChatUsage usage;

    @Data
    public static class ChatChoice {
        @JsonProperty("index")
        private int index;
        @JsonProperty("message")
        private ChatMessage message;
        @JsonProperty("finish_reason")
        private String finishReason;
    }

    @Data
    public static class ChatMessage {
        @JsonProperty("role")
        private String role;
        @JsonProperty("content")
        private String content;
    }

    @Data
    public static class ChatUsage {
        @JsonProperty("prompt_tokens")
        private int promptTokens;
        @JsonProperty("completion_tokens")
        private int completionTokens;
        @JsonProperty("total_tokens")
        private int totalTokens;
    }
}



